package com.weareint.common;

import com.google.gson.Gson;

/**
 * Gson 转换
 * @author johnny
 */
public class GsonUtils {

    private static Gson gson = new Gson();

    public static String toJsonStr(Object o) {
        return gson.toJson(o);
    }

    public static <T> T fromJsonTo(String jsonStr, Class<T> clazz) {
        return gson.fromJson(jsonStr, clazz);
    }
}
